package com.example.petshopping.model;

import com.google.gson.annotations.SerializedName;

/**
 * 用户基本信息响应数据模型
 */
public class AppMemberUserInfoRespVO {

    @SerializedName("id")
    private Long id;

    @SerializedName("nickname")
    private String nickname;

    @SerializedName("avatar")
    private String avatar;

    @SerializedName("mobile")
    private String mobile;

    @SerializedName("sex")
    private Integer sex;
    
    @SerializedName("birthday")
    private String birthday;

    @SerializedName("point")
    private Integer point;

    @SerializedName("experience")
    private Integer experience;

    @SerializedName("level")
    private Level level;

    @SerializedName("brokerageEnabled")
    private Boolean brokerageEnabled;

    /**
     * 用户等级信息
     */
    public static class Level {
        @SerializedName("id")
        private Long id;

        @SerializedName("name")
        private String name;

        @SerializedName("level")
        private Integer level;

        @SerializedName("icon")
        private String icon;

        // Getter and Setter methods for Level
        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getLevel() {
            return level;
        }

        public void setLevel(Integer level) {
            this.level = level;
        }

        public String getIcon() {
            return icon;
        }

        public void setIcon(String icon) {
            this.icon = icon;
        }
    }

    // Getter and Setter methods for main class
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

     public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public Integer getPoint() {
        return point;
    }

    public void setPoint(Integer point) {
        this.point = point;
    }

    public Integer getExperience() {
        return experience;
    }

    public void setExperience(Integer experience) {
        this.experience = experience;
    }

    public Level getLevel() {
        return level;
    }

    public void setLevel(Level level) {
        this.level = level;
    }

    public Boolean getBrokerageEnabled() {
        return brokerageEnabled;
    }

    public void setBrokerageEnabled(Boolean brokerageEnabled) {
        this.brokerageEnabled = brokerageEnabled;
    }

    /**
     * 获取性别描述
     */
    public String getSexDescription() {
        if (sex == null) {
            return "未设置";
        }
        switch (sex) {
            case 1:
                return "男";
            case 2:
                return "女";
            default:
                return "未知";
        }
    }

    /**
     * 获取等级名称（兼容旧版本调用）
     */
    public String getLevelName() {
        return level != null ? level.getName() : "普通会员";
    }

    /**
     * 获取等级图标（兼容旧版本调用）
     */
    public String getLevelIcon() {
        return level != null ? level.getIcon() : null;
    }

    /**
     * 获取等级ID（兼容旧版本调用）
     */
    public Long getLevelId() {
        return level != null ? level.getId() : null;
    }
} 